#include <algorithm>
#include <vector>
#include <cmath>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <set>
#include <map>
#include <cstdlib>
#define LL long long
#define ldb long double
const ldb eps = 1e-9;
const ldb pi = fabsl(atan2(0.0, -1.0));
const int INF = 0x7f7f7f7f;
const LL LINF = 1ll << 60;
const ldb LDINF = 1e42;
#define nextLine() {int c = 0; while ((c = getchar()) != 10 && c != EOF);}
#define fill(a, c) memset(a, c, sizeof a)
#define debug(a) cerr << #a << " " << a;
#define addEdge(a, b) next[edges] = first[a]; first[a] = edges; end[edges] = b; edges++;
using namespace std;
int n;
void Load()
{
	cin >> n;
}

void Solve()
{
	int i, j;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < n; j++)
		{
			if ((j * (2 * j + 1) ) % n == i)
				break;
			if (((2 * j + 1) * (j + 1)) % n == i)
				break;
		}
		if (j == n)
		{
			cout << "NO";
			return;
		}
	}
	cout << "YES";


}

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
	#endif
	Load();
	Solve();
	return 0;
}